﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shCore.js"></script>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shBrushJScript.js"></script>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shBrushCSharp.js"></script>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shBrushXml.js"></script>
    <link type="text/css" rel="stylesheet" href="../../Content/highlighter/styles/shCore.css" />
    <link type="text/css" rel="stylesheet" href="../../Content/highlighter/styles/shCoreEclipse.css" />
    <script type="text/javascript">SyntaxHighlighter.all();</script>
</head>
<body>
    <h3>如何输出Url</h3>
    <b>Url函数</b>
    <pre class="brush:csharp;">
        /// &lt;summary>
        /// 获取Url
        /// &lt;/summary>
        /// &lt;param name="methodName">方法名&lt;/param>
        /// &lt;param name="urlParameters">Url中的参数&lt;/param>
        /// &lt;returns>&lt;/returns>
        Url(string methodName, params StringContainer[] urlParameters)
    </pre>
    <b>1.在当前控制器获取URl</b>
    <pre class="brush:csharp;">
        public class IndexController : BaseController
        {
            [GetHtml("/Index-{id}.html")]
            public void Index()
            {
                string url = this.Url("Index");
            }
            public void Default()
            {
                
            }
        }
    </pre>
    <b>2.获取其它控制器的Url</b>
    <pre class="brush:csharp;">
        public class DefaultController : BaseController
        {
            public void Default()
            {
                int id=12;
                string url = IndexController.Url("Index",id);
            }
        }
    </pre>
</body>
</html>